package cn.training.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import cn.training.UserBean.UserBean;
import cn.training.service.*;

@Controller("HelloWorldController")
@RequestMapping("/")
public class HelloWorldController {
@Autowired
Helloservice helloservice;
    @RequestMapping(value = "/", method = RequestMethod.GET)
    public String initLogin(Model model) {
        return "helloWorld";
    }
    @RequestMapping(value="/init",  method=RequestMethod.POST)
    public String initLogin2(UserBean userbean,Model model) {
      UserBean userbean1= helloservice.searchservice(userbean);
       model.addAttribute("userbean",userbean1);
       return "login";
        
    }
}

